package com.one.group.admin.mapper;

import com.mybatisflex.core.BaseMapper;
import com.one.group.model.dto.VehicleQueryDto;
import com.one.group.model.entity.Vehicle;
import com.one.group.model.vo.VehicleListVo;
import com.one.group.model.vo.VehicleSearchVo;

import java.util.List;
import java.util.Map;

public interface VehicleMapper extends BaseMapper<Vehicle> {

    List<VehicleListVo> findVehicleByQueryDto(VehicleQueryDto vehicleQueryDto);

    /**
     * 根据车牌号和小区ID查询车辆
     * @param plateNo 车牌号
     * @param cellId 小区ID
     * @param tenantId 租户ID
     * @return 车辆信息
     */
    Vehicle selectOneByPlateNoAndCellId(String plateNo, Long cellId, Long tenantId);

    /**
     * 检查车辆是否有车位绑定
     * @param vehicleId 车辆ID
     * @return 是否有绑定
     */
    boolean hasParkingSpaceBinding(Long vehicleId);

    /**
     * 根据车牌号模糊搜索车辆
     * @param plateNo 车牌号（支持模糊搜索）
     * @param tenantId 租户ID
     * @return 车辆搜索结果列表
     */
    List<VehicleSearchVo> searchVehiclesByPlateNo(String plateNo, Long tenantId);
}
